if ($cfg.eCont) {
  $dp = {};
  for (var p in $pdp) if (typeof $pdp[p] == "object") {
    $dp[p] = {};
    for (var pp in $pdp[p]) $dp[p][pp] = $pdp[p][pp]
  } else $dp[p] = $pdp[p]
} else $dp = $pdp;
for (p in $cfg) $dp[p] = $cfg[p];
var $c;
if ($FF) {
  Event.prototype.__defineSetter__("returnValue",
  function($) {
    if (!$) this.preventDefault();
    return $
  });
  Event.prototype.__defineGetter__("srcElement",
  function() {
    var $ = this.target;
    while ($.nodeType != 1) $ = $.parentNode;
    return $
  });
  HTMLElement.prototype.attachEvent = function($, _) {
    var A = $.replace(/on/, "");
    _._ieEmuEventHandler = function($) {
      window.event = $;
      return _()
    };
    this.addEventListener(A, _._ieEmuEventHandler, false)
  }
}
function My97DP() {
  $c = this;
  this.QS = [];
  $div = document.createElement("div");
  $div.className = "WdateDiv";
  $div.innerHTML = "<div id=dpTitle><div class=\"navImg NavImgll\"><a></a></div><div class=\"navImg NavImgl\"><a></a></div><div style=\"float:left\"><div class=\"menuSel MMenu\"></div><input class=yminput></div><div style=\"float:left\"><div class=\"menuSel YMenu\"></div><input class=yminput></div><div class=\"navImg NavImgrr\"><a></a></div><div class=\"navImg NavImgr\"><a></a></div><div style=\"float:right\"></div></div><div style=\"position:absolute;overflow:hidden\"></div><div></div><div id=dpTime><div class=\"menuSel hhMenu\"></div><div class=\"menuSel mmMenu\"></div><div class=\"menuSel ssMenu\"></div><table cellspacing=0 cellpadding=0 border=0><tr><td rowspan=2><span id=dpTimeStr></span> <input class=tB maxlength=2><input value=\":\" class=tm readonly><input class=tE maxlength=2><input value=\":\" class=tm readonly><input class=tE maxlength=2></td><td><button id=dpTimeUp></button></td></tr><tr><td><button id=dpTimeDown></button></td></tr></table></div><div id=dpQS></div><div id=dpControl><input class=dpButton id=dpClearInput type=button><input class=dpButton id=dpTodayInput type=button><input class=dpButton id=dpOkInput type=button></div>";
  attachTabEvent($div,
  function() {
    hideSel()
  });
  A();
  this.init();
  $dp.focusArr = [document, $div.MI, $div.yI, $div.HI, $div.mI, $div.sI, $div.clearI, $div.todayI, $div.okI];
  for (var B = 0; B < $dp.focusArr.length; B++) {
    var _ = $dp.focusArr[B];
    _.nextCtrl = B == $dp.focusArr.length - 1 ? $dp.focusArr[1] : $dp.focusArr[B + 1];
    $dp.attachEvent(_, "onkeydown", _tab)
  }
  $();
  _inputBindEvent("y,M,H,m,s");
  $div.upButton.onclick = function() {
    updownEvent(1)
  };
  $div.downButton.onclick = function() {
    updownEvent( - 1)
  };
  $div.qsDiv.onclick = function() {
    if ($div.qsDivSel.style.display != "block") {
      $c._fillQS();
      showB($div.qsDivSel)
    } else hide($div.qsDivSel)
  };
  document.body.appendChild($div);
  function A() {
    var _ = $("a");
    divs = $("div"),
    ipts = $("input"),
    btns = $("button"),
    spans = $("span");
    $div.navLeftImg = _[0];
    $div.leftImg = _[1];
    $div.rightImg = _[3];
    $div.navRightImg = _[2];
    $div.rMD = divs[9];
    $div.MI = ipts[0];
    $div.yI = ipts[1];
    $div.titleDiv = divs[0];
    $div.MD = divs[4];
    $div.yD = divs[6];
    $div.qsDivSel = divs[10];
    $div.dDiv = divs[11];
    $div.tDiv = divs[12];
    $div.HD = divs[13];
    $div.mD = divs[14];
    $div.sD = divs[15];
    $div.qsDiv = divs[16];
    $div.bDiv = divs[17];
    $div.HI = ipts[2];
    $div.mI = ipts[4];
    $div.sI = ipts[6];
    $div.clearI = ipts[7];
    $div.todayI = ipts[8];
    $div.okI = ipts[9];
    $div.upButton = btns[0];
    $div.downButton = btns[1];
    $div.timeSpan = spans[0];
    function $($) {
      return $div.getElementsByTagName($)
    }
  }
  function $() {
    $div.navLeftImg.onclick = function() {
      $ny = $ny <= 0 ? $ny - 1 : -1;
      if ($ny % 5 == 0) {
        $div.yI.focus();
        return
      }
      $div.yI.value = $dt.y - 1;
      $div.yI.onblur()
    };
    $div.leftImg.onclick = function() {
      $dt.attr("M", -1);
      $div.MI.onblur()
    };
    $div.rightImg.onclick = function() {
      $dt.attr("M", 1);
      $div.MI.onblur()
    };
    $div.navRightImg.onclick = function() {
      $ny = $ny >= 0 ? $ny + 1 : 1;
      if ($ny % 5 == 0) {
        $div.yI.focus();
        return
      }
      $div.yI.value = $dt.y + 1;
      $div.yI.onblur()
    }
  }
}
My97DP.prototype = {
  init: function() {
    $ny = 0;
    $dp.cal = this;
    if ($dp.readOnly && $dp.el.readOnly != null) {
      $dp.el.readOnly = true;
      //ȥ�����д��룬�����readOnlyΪtrueʱtab���л��쳣���� ������ 2012-10-31
      //$dp.el.blur()
    }
    this._dealFmt();
    $dt = this.newdate = new DPDate();
    $tdt = new DPDate();
    $sdt = this.date = new DPDate();
    this.dateFmt = this.doExp($dp.dateFmt);
    this.autoPickDate = $dp.autoPickDate == null ? ($dp.has.st && $dp.has.st ? false: true) : $dp.autoPickDate;
    $dp.autoUpdateOnChanged = $dp.autoUpdateOnChanged == null ? ($dp.isShowOK && $dp.has.d ? false: true) : $dp.autoUpdateOnChanged;
    this.ddateRe = this._initRe("disabledDates");
    this.ddayRe = this._initRe("disabledDays");
    this.sdateRe = this._initRe("specialDates");
    this.sdayRe = this._initRe("specialDays");
    this.minDate = this.doCustomDate($dp.minDate, $dp.minDate != $dp.defMinDate ? $dp.realFmt: $dp.realFullFmt, $dp.defMinDate);
    this.maxDate = this.doCustomDate($dp.maxDate, $dp.maxDate != $dp.defMaxDate ? $dp.realFmt: $dp.realFullFmt, $dp.defMaxDate);
    if (this.minDate.compareWith(this.maxDate) > 0) $dp.errMsg = $lang.err_1;
    if (this.loadDate()) {
      this._makeDateInRange();
      this.oldValue = $dp.el[$dp.elProp]
    } else this.mark(false, 2);
    _setAll($dt);
    $div.timeSpan.innerHTML = $lang.timeStr;
    $div.clearI.value = $lang.clearStr;
    $div.todayI.value = $lang.todayStr;
    $div.okI.value = $lang.okStr;
    $div.okI.disabled = !$c.checkValid($sdt);
    this.initShowAndHide();
    this.initBtn();
    if ($dp.errMsg) alert($dp.errMsg);
    this.draw();
    if ($dp.el.nodeType == 1 && $dp.el["My97Mark"] === undefined) {
      $dp.attachEvent($dp.el, "onkeydown", _tab);
      $dp.attachEvent($dp.el, "onblur",
      function() {
        if ($dp && $dp.dd.style.display == "none") {
          $c.close();
          if ($dp.cal.oldValue != $dp.el[$dp.elProp] && $dp.el.onchange) fireEvent($dp.el, "change")
        }
      });
      $dp.el["My97Mark"] = false
    }
    $c.currFocus = $dp.el;
    hideSel()
  },
  _makeDateInRange: function() {
    var _ = this.checkRange();
    if (_ != 0) {
      var $;
      if (_ > 0) $ = this.maxDate;
      else $ = this.minDate;
      //���alwaysUseStartDateΪtrueʱ����ѡ��Χ������startDateΪ��׼���л����ʱ������ѡ��Χ���Ѻõ����� ������ 2013-04-19
      if ($dp.has.sd && !$dp.alwaysUseStartDate) {
        $dt.y = $.y;
        $dt.M = $.M;
        $dt.d = $.d
      }
      if ($dp.has.st) {
        $dt.H = $.H;
        $dt.m = $.m;
        $dt.s = $.s
      }
    }
  },
  splitDate: function(J, C, Q, E, B, G, F, K, L) {
    var $;
    if (J && J.loadDate) $ = J;
    else {
      $ = new DPDate();
      if (J != "") {
        C = C || $dp.dateFmt;
        var H, P = 0,
        O, A = /yyyy|yyy|yy|y|MMMM|MMM|MM|M|dd|d|%ld|HH|H|mm|m|ss|s|DD|D|WW|W|w/g,
        _ = C.match(A);
        A.lastIndex = 0;
        if (L) O = J.split(/\W+/);
        else {
          var D = 0,
          M = "^";
          while ((O = A.exec(C)) !== null) {
            if (D >= 0) M += C.substring(D, O.index);
            D = A.lastIndex;
            switch (O[0]) {
            case "yyyy":
              M += "(\\d{4})";
              break;
            case "yyy":
              M += "(\\d{3})";
              break;
            case "MMMM":
            case "MMM":
            case "DD":
            case "D":
              M += "(\\D+)";
              break;
            default:
              M += "(\\d\\d?)";
              break
            }
          }
          M += ".*$";
          O = new RegExp(M).exec(J);
          P = 1
        }
        if (O) {
          for (H = 0; H < _.length; H++) {
            var I = O[H + P];
            if (I) switch (_[H]) {
            case "MMMM":
            case "MMM":
              $.M = N(_[H], I);
              break;
            case "y":
            case "yy":
              I = pInt2(I, 0);
              if (I < 50) I += 2000;
              else I += 1900;
              $.y = I;
              break;
            case "yyy":
              $.y = pInt2(I, 0) + $dp.yearOffset;
              break;
            default:
              $[_[H].slice( - 1)] = I;
              break
            }
          }
        } else $.d = 32
      }
    }
    $.coverDate(Q, E, B, G, F, K);
    return $;
    function N(A, $) {
      var _ = A == "MMMM" ? $lang.aLongMonStr: $lang.aMonStr;
      for (var B = 0; B < 12; B++) if (_[B].toLowerCase() == $.substr(0, _[B].length).toLowerCase()) return B + 1;
      return - 1
    }
  },
  _initRe: function(_) {
    var B, $ = $dp[_],
    A = "(?:";
    if ($) {
      for (B = 0; B < $.length; B++) {
        A += this.doExp($[B]);
        if (B != $.length - 1) A += "|"
      }
      A = new RegExp(A + ")")
    } else A = null;
    return A
  },
  update: function() {
    var $ = this.getNewDateStr();
    if ($dp.el[$dp.elProp] != $) $dp.el[$dp.elProp] = $;
    this.setRealValue()
  },
  setRealValue: function($) {
    var _ = $dp.$($dp.vel),
    $ = rtn($, this.getNewDateStr($dp.realFmt));
    if (_) _.value = $;
    $dp.el["realValue"] = $
  },
  doExp: function(s) {
    var ps = "yMdHms",
    arr, tmpEval, re = /#?\{(.*?)\}/;
    s = s + "";
    for (var i = 0; i < ps.length; i++) s = s.replace("%" + ps.charAt(i), this.getP(ps.charAt(i), null, $tdt));
    if (s.substring(0, 3) == "#F{") {
      s = s.substring(3, s.length - 1);
      if (s.indexOf("return ") < 0) s = "return " + s;
      s = $dp.win.eval("new Function(\"" + s + "\");");
      s = s()
    } else while ((arr = re.exec(s)) != null) {
      arr.lastIndex = arr.index + arr[1].length + arr[0].length - arr[1].length - 1;
      tmpEval = pInt(eval(arr[1]));
      if (tmpEval < 0) tmpEval = "9700" + ( - tmpEval);
      s = s.substring(0, arr.index) + tmpEval + s.substring(arr.lastIndex + 1)
    }
    return s
  },
  doCustomDate: function(A, B, _) {
    var $;
    A = this.doExp(A);
    if (!A || A == "") A = _;
    if (typeof A == "object") $ = A;
    else {
      $ = this.splitDate(A, B, null, null, 1, 0, 0, 0, true);
      $.y = ("" + $.y).replace(/^9700/, "-");
      $.M = ("" + $.M).replace(/^9700/, "-");
      $.d = ("" + $.d).replace(/^9700/, "-");
      $.H = ("" + $.H).replace(/^9700/, "-");
      $.m = ("" + $.m).replace(/^9700/, "-");
      $.s = ("" + $.s).replace(/^9700/, "-");
      if (A.indexOf("%ld") >= 0) {
        A = A.replace(/%ld/g, "0");
        $.d = 0;
        $.M = pInt($.M) + 1
      }
      $.refresh()
    }
    return $
  },
  loadDate: function() {
    var _, $;
    if ($dp.alwaysUseStartDate || ($dp.startDate != "" && $dp.el[$dp.elProp] == "")) {
      _ = this.doExp($dp.startDate);
      $ = $dp.realFmt
    } else {
      _ = $dp.el[$dp.elProp];
      $ = this.dateFmt
    }
    $dt.loadFromDate(this.splitDate(_, $));
    if (_ != "") {
      var A = 1;
      if ($dp.has.sd && !this.isDate($dt)) {
        $dt.y = $tdt.y;
        $dt.M = $tdt.M;
        $dt.d = $tdt.d;
        A = 0
      }
      if ($dp.has.st && !this.isTime($dt)) {
        $dt.H = $tdt.H;
        $dt.m = $tdt.m;
        $dt.s = $tdt.s;
        A = 0
      }
      //�������startDate�󣬵�startDate�������Сֵ�ȽϺ󲻺Ϸ�ʱ����ʾ���Ϸ������⣨�޸�Ϊ����������е�ֵ��У�飩 ������ 2014-04-19
      if(_ == $dp.el[$dp.elProp]){
          return A && this.checkValid($dt)
      }else{
          return A;
      }
    }
    return 1
  },
  isDate: function($) {
    if ($.y != null) $ = doStr($.y, 4) + "-" + $.M + "-" + $.d;
    return $.match(/^((\d{2}(([02468][048])|([13579][26]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|([1-2][0-9])))))|(\d{2}(([02468][1235679])|([13579][01345789]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\s(((0?[0-9])|([1-2][0-3]))\:([0-5]?[0-9])((\s)|(\:([0-5]?[0-9])))))?$/)
  },
  isTime: function($) {
    if ($.H != null) $ = $.H + ":" + $.m + ":" + $.s;
    return $.match(/^([0-9]|([0-1][0-9])|([2][0-3])):([0-9]|([0-5][0-9])):([0-9]|([0-5][0-9]))$/)
  },
  checkRange: function($, A) {
    $ = $ || $dt;
    var _ = $.compareWith(this.minDate, A);
    if (_ > 0) {
      _ = $.compareWith(this.maxDate, A);
      if (_ < 0) _ = 0
    }
    return _
  },
  checkValid: function($, A, B) {
    A = A || $dp.has.minUnit;
    var _ = this.checkRange($, A);
    if (_ == 0) {
      _ = 1;
      if (A == "d" && B == null) B = Math.abs((new Date($.y, $.M - 1, $.d).getDay() - $dp.firstDayOfWeek + 7) % 7);
      _ = !this.testDisDay(B) && !this.testDisDate($, A)
    } else _ = 0;
    return _
  },
  checkAndUpdate: function() {
    var _ = $dp.el,
    A = this,
    $ = $dp.el[$dp.elProp];
    if ($dp.errDealMode >= 0 && $dp.errDealMode <= 2 && $ != null) {
      if ($ != "") A.date.loadFromDate(A.splitDate($, A.dateFmt));
      if ($ == "" || (A.isDate(A.date) && A.isTime(A.date) && A.checkValid(A.date))) {
        if ($ != "") {
          A.newdate.loadFromDate(A.date);
          A.update()
        } else A.setRealValue("")
      } else return false
    }
    return true
  },
  close: function($) {
    hideSel();
    if (this.checkAndUpdate()) {
      this.mark(true);
      $dp.hide()
    } else {
      if ($) {
        _cancelKey($);
        this.mark(false, 2)
      } else this.mark(false);
      $dp.show()
    }
  },
  _fd: function() {
    var E, C, D, K, A, H = new sb(),
    F = $lang.aWeekStr,
    G = $dp.firstDayOfWeek,
    I = "",
    $ = "",
    _ = new DPDate($dt.y, $dt.M, $dt.d, 0, 0, 0),
    J = _.y,
    B = _.M;
    A = 1 - new Date(J, B - 1, 1).getDay() + G;
    if (A > 1) A -= 7;
    H.a("<table class=WdayTable width=100% border=0 cellspacing=0 cellpadding=0>");
    H.a("<tr class=MTitle align=center>");
    if ($dp.isShowWeek) H.a("<td>" + F[0] + "</td>");
    for (E = 0; E < 7; E++) H.a("<td>" + F[(G + E) % 7 + 1] + "</td>");
    H.a("</tr>");
    for (E = 1, C = A; E < 7; E++) {
      H.a("<tr>");
      for (D = 0; D < 7; D++) {
        _.loadDate(J, B, C++);
        _.refresh();
        if (_.M == B) {
          K = true;
          if (_.compareWith($sdt, "d") == 0) I = "Wselday";
          else if (_.compareWith($tdt, "d") == 0) I = "Wtoday";
          else I = ($dp.highLineWeekDay && (0 == (G + D) % 7 || 6 == (G + D) % 7) ? "Wwday": "Wday");
          $ = ($dp.highLineWeekDay && (0 == (G + D) % 7 || 6 == (G + D) % 7) ? "WwdayOn": "WdayOn")
        } else if ($dp.isShowOthers) {
          K = true;
          I = "WotherDay";
          $ = "WotherDayOn"
        } else K = false;
        if ($dp.isShowWeek && D == 0 && (E < 4 || K)) H.a("<td class=Wweek>" + getWeek(_, $dp.firstDayOfWeek == 0 ? 1 : 0) + "</td>");
        H.a("<td ");
        if (K) {
          if (this.checkValid(_, "d", D)) {
            if (this.testSpeDay(Math.abs((new Date(_.y, _.M - 1, _.d).getDay() - $dp.firstDayOfWeek + 7) % 7)) || this.testSpeDate(_)) I = "WspecialDay";
            H.a("onclick=\"day_Click(" + _.y + "," + _.M + "," + _.d + ");\" ");
            H.a("onmouseover=\"this.className='" + $ + "'\" ");
            H.a("onmouseout=\"this.className='" + I + "'\" ")
          } else I = "WinvalidDay";
          H.a("class=" + I);
          H.a(">" + _.d + "</td>")
        } else H.a("></td>")
      }
      H.a("</tr>")
    }
    H.a("</table>");
    return H.j()
  },
  testDisDate: function(_, A) {
    var $ = this.testDate(_, this.ddateRe, A);
    return (this.ddateRe && $dp.opposite) ? !$: $
  },
  testDisDay: function($) {
    return this.testDay($, this.ddayRe)
  },
  testSpeDate: function($) {
    return this.testDate($, this.sdateRe)
  },
  testSpeDay: function($) {
    return this.testDay($, this.sdayRe)
  },
  testDate: function($, B, A) {
    var _ = A == "d" ? $dp.realDateFmt: $dp.realFmt;
    return B ? B.test(this.getDateStr(_, $)) : 0
  },
  testDay: function(_, $) {
    return $ ? $.test(_) : 0
  },
  _f: function(p, c, r, e, isR) {
    var s = new sb(),
    fp = isR ? "r" + p: p;
    bak = $dt[p];
    s.a("<table cellspacing=0 cellpadding=3 border=0");
    for (var i = 0; i < r; i++) {
      s.a("<tr nowrap=\"nowrap\">");
      for (var j = 0; j < c; j++) {
        s.a("<td nowrap ");
        $dt[p] = eval(e);
        if (($dp.opposite && this.checkRange($dt, p) == 0) || this.checkValid($dt, p)) {
          s.a("class='menu' onmouseover=\"this.className='menuOn'\" onmouseout=\"this.className='menu'\" onmousedown=\"");
          s.a("hide($div." + p + "D);$div." + fp + "I.value=" + $dt[p] + ";$div." + fp + "I.blur();\"")
        } else s.a("class='invalidMenu'");
        s.a(">" + (p == "M" ? $lang.aMonStr[$dt[p] - 1] : $dt[p]) + "</td>")
      }
      s.a("</tr>")
    }
    s.a("</table>");
    $dt[p] = bak;
    return s.j()
  },
  _fMyPos: function($, _) {
    if ($) {
      var A = $.offsetLeft;
      if ($IE) A = $.getBoundingClientRect().left;
      _.style.left = A
    }
  },
  _fM: function($) {
    this._fMyPos($, $div.MD);
    $div.MD.innerHTML = this._f("M", 2, 6, "i+j*6+1", $ == $div.rMI)
  },
  _fy: function(_, B, A) {
    var $ = new sb();
    A = A || _ == $div.ryI;
    B = rtn(B, $dt.y - 5);
    $.a(this._f("y", 2, 5, B + "+i+j*5", A));
    $.a("<table cellspacing=0 cellpadding=3 border=0 align=center><tr><td ");
    $.a(this.minDate.y < B ? "class='menu' onmouseover=\"this.className='menuOn'\" onmouseout=\"this.className='menu'\" onmousedown='if(event.preventDefault)event.preventDefault();event.cancelBubble=true;$c._fy(0," + (B - 10) + "," + A + ")'": "class='invalidMenu'");
    $.a(">\u2190</td><td class='menu' onmouseover=\"this.className='menuOn'\" onmouseout=\"this.className='menu'\" onmousedown=\"hide($div.yD);$div.yI.blur();\">\xd7</td><td ");
    $.a(this.maxDate.y >= B + 10 ? "class='menu' onmouseover=\"this.className='menuOn'\" onmouseout=\"this.className='menu'\" onmousedown='if(event.preventDefault)event.preventDefault();event.cancelBubble=true;$c._fy(0," + (B + 10) + "," + A + ")'": "class='invalidMenu'");
    $.a(">\u2192</td></tr></table>");
    this._fMyPos(_, $div.yD);
    $div.yD.innerHTML = $.j()
  },
  _fHMS: function(A, _, $) {
    $div[A + "D"].innerHTML = this._f(A, 6, _, $)
  },
  _fH: function() {
    this._fHMS("H", 4, "i * 6 + j")
  },
  _fm: function() {
    this._fHMS("m", 2, "i * 30 + j * 5")
  },
  _fs: function() {
    this._fHMS("s", 1, "j * 10")
  },
  _fillQS: function(C, A) {
    this.initQS();
    var $ = A ? "".split("").reverse().join("") : $lang.quickStr,
    B = this.QS,
    E = B.style,
    _ = new sb();
    _.a("<table class=WdayTable width=100% height=100% border=0 cellspacing=0 cellpadding=0>");
    _.a("<tr class=MTitle><td><div style=\"float:left\">" + $ + "</div>");
    if (!C) _.a("<div style=\"float:right;cursor:pointer\" onclick=\"hide($div.qsDivSel);\">\xd7</div>");
    _.a("</td></tr>");
    var nullNum = 0;
    for (var D = 0; D < B.length; D++) if (B[D]) {
      _.a("<tr><td style='text-align:left' nowrap='nowrap' class='menu' onmouseover=\"this.className='menuOn'\" onmouseout=\"this.className='menu'\" onclick=\"");
      _.a("day_Click(" + B[D].y + ", " + B[D].M + ", " + B[D].d + "," + B[D].H + "," + B[D].m + "," + B[D].s + ");\">");
      _.a(" " + this.getDateStr(null, B[D]));
      _.a("</td></tr>")
    } else{
    	nullNum++;
    }
    for(var idx=0; idx < nullNum; idx++){
    	_.a("<tr><td class='menu'>&nbsp;</td></tr>");
    }
    _.a("</table>");
    $div.qsDivSel.innerHTML = _.j()
  },
  _dealFmt: function() {
    $(/w/);
    $(/WW|W/);
    $(/DD|D/);
    $(/yyyy|yyy|yy|y/);
    $(/MMMM|MMM|MM|M/);
    $(/dd|d/);
    $(/HH|H/);
    $(/mm|m/);
    $(/ss|s/);
    $dp.has.sd = ($dp.has.y || $dp.has.M || $dp.has.d) ? true: false;
    $dp.has.st = ($dp.has.H || $dp.has.m || $dp.has.s) ? true: false;
    $dp.realFullFmt = $dp.realFullFmt.replace(/%Date/, $dp.realDateFmt).replace(/%Time/, $dp.realTimeFmt);
    if ($dp.has.sd) {
      if ($dp.has.st) $dp.realFmt = $dp.realFullFmt;
      else $dp.realFmt = $dp.realDateFmt
    } else $dp.realFmt = $dp.realTimeFmt;
    function $(_) {
      var $ = (_ + "").slice(1, 2);
      $dp.has[$] = _.exec($dp.dateFmt) ? ($dp.has.minUnit = $, true) : false
    }
  },
  initShowAndHide: function() {
    var $ = 0;
    $dp.has.y ? ($ = 1, show($div.yI, $div.navLeftImg, $div.navRightImg)) : hide($div.yI, $div.navLeftImg, $div.navRightImg);
    ($dp.has.showM!=undefined ? $dp.has.showM : $dp.has.M) ? ($ = 1, show($div.MI, $div.leftImg, $div.rightImg)) : hide($div.MI, $div.leftImg, $div.rightImg);
    $ ? show($div.titleDiv) : hide($div.titleDiv);
    if ($dp.has.st) {
      show($div.tDiv);
      disHMS($div.HI, $dp.has.H);
      disHMS($div.mI, $dp.has.m);
      disHMS($div.sI, $dp.has.s)
    } else hide($div.tDiv);
    shorH($div.clearI, $dp.isShowClear);
    shorH($div.todayI, $dp.isShowToday);
    shorH($div.okI, $dp.isShowOK);
    shorH($div.qsDiv, !$dp.doubleCalendar && $dp.has.d && $dp.qsEnabled);
    if ($dp.eCont || !($dp.isShowClear || $dp.isShowToday || $dp.isShowOK)) hide($div.bDiv);
    else show($div.bDiv)
  },
  mark: function(B, D) {
    var A = $dp.el,
    _ = $FF ? "class": "className";
    if (B) C(A);
    else {
      if (D == null) D = $dp.errDealMode;
      switch (D) {
      case 0:
        if (confirm($lang.errAlertMsg)) {
          A[$dp.elProp] = this.oldValue;
          C(A)
        } else $(A);
        break;
      case 1:
        A[$dp.elProp] = this.oldValue;
        C(A);
        break;
      case 2:
        $(A);
        break
      }
    }
    function C(A) {
      var B = A.className;
      if (B) {
        var $ = B.replace(/WdateFmtErr/g, "");
        if (B != $) A.setAttribute(_, $)
      }
    }
    function $($) {
      $.setAttribute(_, $.className + " WdateFmtErr")
    }
  },
  getP: function(D, _, $) {
    $ = $ || $sdt;
    var H, C = [D + D, D],
    E,
    A = $[D],
    F = function($) {
      return doStr(A, $.length)
    };
    switch (D) {
    case "w":
      A = getDay($);
      break;
    case "D":
      var G = getDay($) + 1;
      F = function($) {
        return $.length == 2 ? $lang.aLongWeekStr[G] : $lang.aWeekStr[G]
      };
      break;
    case "W":
      A = getWeek($);
      break;
    case "y":
      C = ["yyyy", "yyy", "yy", "y"];
      _ = _ || C[0];
      F = function(_) {
        return doStr((_.length < 4) ? (_.length < 3 ? $.y % 100 : ($.y + 2000 - $dp.yearOffset) % 1000) : A, _.length)
      };
      break;
    case "M":
      C = ["MMMM", "MMM", "MM", "M"];
      F = function($) {
        return ($.length == 4) ? $lang.aLongMonStr[A - 1] : ($.length == 3) ? $lang.aMonStr[A - 1] : doStr(A, $.length)
      };
      break
    }
    _ = _ || D + D;
    if ("yMdHms".indexOf(D) > -1 && D != "y" && !$dp.has[D]) if ("Hms".indexOf(D) > -1) A = 0;
    else A = 1;
    var B = [];
    for (H = 0; H < C.length; H++) {
      E = C[H];
      if (_.indexOf(E) >= 0) {
        B[H] = F(E);
        _ = _.replace(E, "{" + H + "}")
      }
    }
    for (H = 0; H < B.length; H++) _ = _.replace(new RegExp("\\{" + H + "\\}", "g"), B[H]);
    return _
  },
  getDateStr: function(_, $) {
    $ = $ || this.splitDate($dp.el[$dp.elProp], this.dateFmt) || $sdt;
    _ = _ || this.dateFmt;
    if (_.indexOf("%ld") >= 0) {
      var A = new DPDate();
      A.loadFromDate($);
      A.d = 0;
      A.M = pInt(A.M) + 1;
      A.refresh();
      _ = _.replace(/%ld/g, A.d)
    }
    var B = "ydHmswW";
    for (var D = 0; D < B.length; D++) {
      var C = B.charAt(D);
      _ = this.getP(C, _, $)
    }
    if ($dp.has["D"]) {
      _ = _.replace(/DD/g, "%dd").replace(/D/g, "%d");
      _ = this.getP("M", _, $);
      _ = _.replace(/\%dd/g, this.getP("D", "DD")).replace(/\%d/g, this.getP("D", "D"))
    } else _ = this.getP("M", _, $);
    return _
  },
  getNewP: function(_, $) {
    return this.getP(_, $, $dt)
  },
  getNewDateStr: function($) {
    return this.getDateStr($, $dt)
  },
  draw: function() {
    $c._dealFmt();
    $div.rMD.innerHTML = "";
    if ($dp.doubleCalendar) {
      $c.autoPickDate = true;
      $dp.isShowOthers = false;
      $div.className = "WdateDiv WdateDiv2";
      var $ = new sb();
      $.a("<table class=WdayTable2 width=100% cellspacing=0 cellpadding=0 border=1><tr><td valign=top>");
      $.a(this._fd());
      $.a("</td><td valign=top>");
      $dt.attr("M", 1);
      $.a(this._fd());
      $div.rMI = $div.MI.cloneNode(true);
      $div.ryI = $div.yI.cloneNode(true);
      $div.rMD.appendChild($div.rMI);
      $div.rMD.appendChild($div.ryI);
      $div.rMI.value = $lang.aMonStr[$dt.M - 1];
      $div.rMI["realValue"] = $dt.M;
      $div.ryI.value = $dt.y;
      _inputBindEvent("rM,ry");
      $div.rMI.className = $div.ryI.className = "yminput";
      $dt.attr("M", -1);
      $.a("</td></tr></table>");
      $div.dDiv.innerHTML = $.j()
    } else {
      $div.className = "WdateDiv";
      $div.dDiv.innerHTML = this._fd()
    }
    if (!$dp.has.d || $dp.autoShowQS) {
      this._fillQS(true);
      showB($div.qsDivSel)
    } else hide($div.qsDivSel);
    this.autoSize()
  },
  autoSize: function() {
    var _ = parent.document.getElementsByTagName("iframe");
    for (var C = 0; C < _.length; C++) {
      var $ = $div.style.height;
      $div.style.height = "";
      var A = $div.offsetHeight;
      if (_[C].contentWindow == window && A) {
        _[C].style.width = $div.offsetWidth + "px";
        var B = $div.tDiv.offsetHeight;
        if (B && $div.bDiv.style.display == "none" && $div.tDiv.style.display != "none" && document.body.scrollHeight - A >= B) {
          A += B;
          $div.style.height = A
        } else $div.style.height = $;
        _[C].style.height = Math.max(A, $div.offsetHeight) + "px"
      }
    }
    $div.qsDivSel.style.width = $div.dDiv.offsetWidth;
    $div.qsDivSel.style.height = $div.dDiv.offsetHeight
  },
  pickDate: function() {
    $dt.d = Math.min(new Date($dt.y, $dt.M, 0).getDate(), $dt.d);
    $sdt.loadFromDate($dt);
    this.update();
    if (!$dp.eCont) if (this.checkValid($dt)) {
      elFocus();
      hide($dp.dd)
    }
    if ($dp.onpicked) callFunc("onpicked")
  },
  initBtn: function() {
    $div.clearI.onclick = function() {
      if (!callFunc("onclearing")) {
        $dp.el[$dp.elProp] = "";
        $c.setRealValue("");
        elFocus();
        hide($dp.dd);
        if ($dp.oncleared) callFunc("oncleared")
      }
    };
    $div.okI.onclick = function() {
      day_Click()
    };
    if (this.checkValid($tdt)) {
      $div.todayI.disabled = false;
      $div.todayI.onclick = function() {
        $dt.loadFromDate($tdt);
        day_Click()
      }
    } else $div.todayI.disabled = true
  },
  initQS: function() {
    var H, G, A, F, C = [],
    $ = 5,
    E = $dp.quickSel.length,
    _ = $dp.has.minUnit;
    if (E > $) E = $;
    else if (_ == "m" || _ == "s") C = [ - 60, -30, 0, 30, 60, -15, 15, -45, 45];
    else for (H = 0; H < $; H++) C[H] = $dt[_] - 2 + H;
    for (H = G = 0; H < E; H++) {
      A = this.doCustomDate($dp.quickSel[H]);
      if (this.checkValid(A)) this.QS[G++] = A
    }
    var B = "yMdHms",
    D = [1, 1, 1, 0, 0, 0];
    for (H = 0; H <= B.indexOf(_); H++) D[H] = $dt[B.charAt(H)];
    for (H = 0; G < $; H++) if (H < C.length) {
      A = new DPDate(D[0], D[1], D[2], D[3], D[4], D[5]);
      A[_] = C[H];
      A.refresh();
      if (this.checkValid(A)) this.QS[G++] = A
    } else this.QS[G++] = null
  }
};
function elFocus() {
  var _ = $dp.el;
  try {
    if (_.style.display != "none" && _.type != "hidden" && (_.nodeName.toLowerCase() == "input" || _.nodeName.toLowerCase() == "textarea")) {
      if ($dp.srcEl == _) $dp.el["My97Mark"] = true;
      $dp.el.focus()
    }
  } catch($) {}
  setTimeout(function() {
    _["My97Mark"] = false
  },
  197)
}
function sb() {
  this.s = new Array();
  this.i = 0;
  this.a = function($) {
    this.s[this.i++] = $
  };
  this.j = function() {
    return this.s.join("")
  }
}
function getWeek($, B) {
  B = B || 0;
  var A = new Date($.y, $.M - 1, $.d + B),
  _ = new Date($.y, 0, 4);
  if ($dp.weekMethod == "ISO8601") {
    A.setDate(A.getDate() - (A.getDay() + 6) % 7 + 3);
    return Math.round((A.valueOf() - _.valueOf()) / (7 * 86400000)) + 1
  } else {
    _.setDate(1);
    A = Math.round((A.valueOf() - _.valueOf()) / 86400000);
    return Math.ceil((A + (_.getDay() + 1)) / 7)
  }
}
function getDay($) {
  var _ = new Date($.y, $.M - 1, $.d);
  return _.getDay()
}
function show() {
  setDisp(arguments, "")
}
function showB() {
  setDisp(arguments, "block")
}
function hide() {
  setDisp(arguments, "none")
}
function setDisp(_, $) {
  for (i = 0; i < _.length; i++) _[i].style.display = $
}
function shorH(_, $) {
  $ ? show(_) : hide(_)
}
function disHMS(_, $) {
  if ($) _.disabled = false;
  else {
    _.disabled = true;
    _.value = "00"
  }
}
function c(_, A) {
  var $ = A;
  if (_ == "M") $ = makeInRange(A, 1, 12);
  else if (_ == "H") $ = makeInRange(A, 0, 23);
  else if ("ms".indexOf(_) >= 0) $ = makeInRange(A, 0, 59);
  if ($sdt[_] != A && !callFunc(_ + "changing")) {
    var C = $c.checkRange();
    if (C == 0) sv(_, $);
    //���alwaysUseStartDateΪtrueʱ����ѡ��Χ������startDateΪ��׼���л����ʱ������ѡ��Χ���Ѻõ����� ������ 2013-04-19
    else if (C < 0) sv(_, $c.minDate[_]);
    else if (C > 0) sv(_, $c.maxDate[_]);
    $div.okI.disabled = !$c.checkValid($sdt);
    if ("yMd".indexOf(_) >= 0) $c.draw();
    callFunc(_ + "changed")
  }
  function B($) {
    _setAll($c.checkValid($) ? $: $sdt)
  }
}
function _setAll($) {
  sv("y", $.y);
  sv("M", $.M);
  sv("d", $.d);
  sv("H", $.H);
  sv("m", $.m);
  sv("s", $.s)
}
function day_Click(F, B, _, D, C, A) {
  var $ = new DPDate($dt.y, $dt.M, $dt.d, $dt.H, $dt.m, $dt.s);
  $dt.loadDate(F, B, _, D, C, A);
  if (!callFunc("onpicking")) {
    var E = $.y == F && $.M == B && $.d == _;
    if (!E && arguments.length != 0) {
      c("y", F);
      c("M", B);
      c("d", _);
      $c.currFocus = $dp.el;
      dealAutoUpdate()
    }
    if ($c.autoPickDate || E || arguments.length == 0) $c.pickDate()
  } else $dt = $
}
function dealAutoUpdate() {
  if ($dp.autoUpdateOnChanged) {
    $c.update();
    $dp.el.focus()
  }
}
function callFunc($) {
  var _;
  if ($dp[$]) _ = $dp[$].call($dp.el, $dp);
  return _
}
function sv(_, $) {
  if ($ == null) $ = $dt[_];
  $sdt[_] = $dt[_] = $;
  if ("yHms".indexOf(_) >= 0) $div[_ + "I"].value = $;
  if (_ == "M") {
    $div.MI["realValue"] = $;
    $div.MI.value = $lang.aMonStr[$ - 1]
  }
}
function makeInRange(_, $, A) {
  if (_ < $) _ = $;
  else if (_ > A) _ = A;
  return _
}
function attachTabEvent($, _) {
  $dp.attachEvent($, "onkeydown",
  function() {
    var $ = event,
    A = ($.which == undefined) ? $.keyCode: $.which;
    if (A == 9) _()
  })
}
function doStr($, _) {
  $ = $ + "";
  while ($.length < _) $ = "0" + $;
  return $
}
function hideSel() {
  hide($div.yD, $div.MD, $div.HD, $div.mD, $div.sD)
}
function updownEvent($) {
  var _ = $c.currFocus;
  if (_ != $div.HI && _ != $div.mI && _ != $div.sI) _ = $div.HI;
  switch (_) {
  case $div.HI:
    c("H", $dt.H + $);
    break;
  case $div.mI:
    c("m", $dt.m + $);
    break;
  case $div.sI:
    c("s", $dt.s + $);
    break
  }
  dealAutoUpdate()
}
function DPDate(D, A, $, C, B, _) {
  this.loadDate(D, A, $, C, B, _)
}
DPDate.prototype = {
  loadDate: function(E, B, _, D, C, A) {
    var $ = new Date();
    this.y = pInt3(E, this.y, $.getFullYear());
    this.M = pInt3(B, this.M, $.getMonth() + 1);
    this.d = $dp.has.d ? pInt3(_, this.d, $.getDate()) : 1;
    this.H = pInt3(D, this.H, $.getHours());
    this.m = pInt3(C, this.m, $.getMinutes());
    this.s = pInt3(A, this.s, $.getSeconds())
  },
  loadFromDate: function($) {
    if ($) this.loadDate($.y, $.M, $.d, $.H, $.m, $.s)
  },
  coverDate: function(E, B, _, D, C, A) {
    var $ = new Date();
    this.y = pInt3(this.y, E, $.getFullYear());
    this.M = pInt3(this.M, B, $.getMonth() + 1);
    this.d = $dp.has.d ? pInt3(this.d, _, $.getDate()) : 1;
    this.H = pInt3(this.H, D, $.getHours());
    this.m = pInt3(this.m, C, $.getMinutes());
    this.s = pInt3(this.s, A, $.getSeconds())
  },
  compareWith: function($, C) {
    var A = "yMdHms",
    _, B;
    C = A.indexOf(C);
    C = C >= 0 ? C: 5;
    for (var D = 0; D <= C; D++) {
      B = A.charAt(D);
      _ = this[B] - $[B];
      if (_ > 0) return 1;
      else if (_ < 0) return - 1
    }
    return 0
  },
  refresh: function() {
    var $ = new Date(this.y, this.M - 1, this.d, this.H, this.m, this.s);
    this.y = $.getFullYear();
    this.M = $.getMonth() + 1;
    this.d = $.getDate();
    this.H = $.getHours();
    this.m = $.getMinutes();
    this.s = $.getSeconds();
    return ! isNaN(this.y)
  },
  attr: function(_, $) {
    if ("yMdHms".indexOf(_) >= 0) {
      var A = this.d;
      if (_ == "M") this.d = 1;
      this[_] += $;
      this.refresh();
      this.d = A
    }
  }
};
function pInt($) {
  return parseInt($, 10)
}
function pInt2($, _) {
  return rtn(pInt($), _)
}
function pInt3($, A, _) {
  return pInt2($, rtn(A, _))
}
function rtn($, _) {
  return $ == null || isNaN($) ? _: $
}
function fireEvent(A, $) {
  if ($IE) A.fireEvent("on" + $);
  else {
    var _ = document.createEvent("HTMLEvents");
    _.initEvent($, true, true);
    A.dispatchEvent(_)
  }
}
function _foundInput($) {
  var A, B, _ = "y,M,H,m,s,ry,rM".split(",");
  for (B = 0; B < _.length; B++) {
    A = _[B];
    if ($div[A + "I"] == $) return A.slice(A.length - 1, A.length)
  }
  return 0
}
function _focus($) {
  var _ = _foundInput(this);
  if (!_) return;
  $c.currFocus = this;
  if (_ == "y") this.className = "yminputfocus";
  else if (_ == "M") {
    this.className = "yminputfocus";
    this.value = this["realValue"]
  }
  this.select();
  $c["_f" + _](this);
  showB($div[_ + "D"])
}
function _blur(showDiv) {
  var p = _foundInput(this),
  isR,
  mStr,
  v = this.value,
  oldv = $dt[p];
  if (p == 0) return;
  $dt[p] = Number(v) >= 0 ? Number(v) : $dt[p];
  if (p == "y") {
    isR = this == $div.ryI;
    if (isR && $dt.M == 12) $dt.y -= 1
  } else if (p == "M") {
    isR = this == $div.rMI;
    if (isR) {
      mStr = $lang.aMonStr[$dt[p] - 1];
      if (oldv == 12) $dt.y += 1;
      $dt.attr("M", -1)
    }
    if ($sdt.M == $dt.M) this.value = mStr || $lang.aMonStr[$dt[p] - 1];
    if (($sdt.y != $dt.y)) c("y", $dt.y)
  }
  eval("c(\"" + p + "\"," + $dt[p] + ")");
  if (showDiv !== true) {
    if (p == "y" || p == "M") this.className = "yminput";
    hide($div[p + "D"])
  }
  dealAutoUpdate()
}
function _cancelKey($) {
  if ($.preventDefault) {
    $.preventDefault();
    $.stopPropagation()
  } else {
    $.cancelBubble = true;
    $.returnValue = false
  }
  if ($OPERA) $.keyCode = 0
}
function _inputBindEvent($) {
  var A = $.split(",");
  for (var B = 0; B < A.length; B++) {
    var _ = A[B] + "I";
    $div[_].onfocus = _focus;
    $div[_].onblur = _blur
  }
}
function _tab(M) {
  var H = M.srcElement || M.target,
  Q = M.which || M.keyCode;
  isShow = $dp.eCont ? true: $dp.dd.style.display != "none";
  if (Q >= 96 && Q <= 105) Q -= 48;
  if ($dp.enableKeyboard && isShow) {
    if (!H.nextCtrl) {
      H.nextCtrl = $dp.focusArr[1];
      $c.currFocus = $dp.el
    }
    if (H == $dp.el) $c.currFocus = $dp.el;
    if (Q == 27) if (H == $dp.el) {
      $c.close();
      return
    } else $dp.el.focus();
    if (Q >= 37 && Q <= 40) {
      var U;
      if ($c.currFocus == $dp.el || $c.currFocus == $div.okI) if ($dp.has.d) {
        U = "d";
        if (Q == 38) $dt[U] -= 7;
        else if (Q == 39) $dt[U] += 1;
        else if (Q == 37) $dt[U] -= 1;
        else $dt[U] += 7;
        $dt.refresh();
        c("y", $dt["y"]);
        c("M", $dt["M"]);
        c("d", $dt[U]);
        _cancelKey(M);
        return
      } else {
        U = $dp.has.minUnit;
        $div[U + "I"].focus()
      }
      U = U || _foundInput($c.currFocus);
      if (U) {
        if (Q == 38 || Q == 39) $dt[U] += 1;
        else $dt[U] -= 1;
        $dt.refresh();
        $c.currFocus.value = $dt[U];
        _blur.call($c.currFocus, true);
        $c.currFocus.select()
      }
    } else if (Q == 9) {
      var D = H.nextCtrl;
      for (var R = 0; R < $dp.focusArr.length; R++) if (D.disabled == true || D.offsetHeight == 0) D = D.nextCtrl;
      else break;
      //�޸Ĵ��룬���tab���л���������ѡ����л�����������֮����л����� ������ 2012-10-31
      if ($c.currFocus != D && $c.currFocus != $dp.el) {
        $c.currFocus = D;
        D.focus();
        return false;
      }
      //�������룬ʵ��tab���л�ʧȥ����ʱ����ѡ����Զ��رչ��� ������ 2012-10-31
      if(H == $dp.el) {
    	  $c.close();
      }
    } else if (Q == 13) {
      _blur.call($c.currFocus);
      if ($c.currFocus.type == "button") $c.currFocus.click();
      else{
        if($dp.cal.oldValue == $dp.el[$dp.elProp])
            $c.pickDate();
        else 
            $c.close();
      }
      $c.currFocus = $dp.el
    }
  } else if (Q == 9 && H == $dp.el) $c.close();
  if ($dp.enableInputMask && !$OPERA && !$dp.readOnly && $c.currFocus == $dp.el && (Q >= 48 && Q <= 57)) {
    var T = $dp.el,
    S = T.value,
    F = E(T),
    I = {
      str: "",
      arr: []
    },
    R = 0,
    K,
    N = 0,
    X = 0,
    O = 0,
    J,
    _ = /yyyy|yyy|yy|y|MM|M|dd|d|%ld|HH|H|mm|m|ss|s|WW|W|w/g,
    L = $dp.dateFmt.match(_),
    B,
    A,
    $,
    V,
    W,
    G,
    J = 0;
    if (S != "") {
      O = S.match(/[0-9]/g);
      O = O == null ? 0 : O.length;
      for (R = 0; R < L.length; R++) O -= Math.max(L[R].length, 2);
      O = O >= 0 ? 1 : 0;
      if (O == 1 && F >= S.length) F = S.length - 1
    }
    S = S.substring(0, F) + String.fromCharCode(Q) + S.substring(F + O);
    F++;
    for (R = 0; R < S.length; R++) {
      var C = S.charAt(R);
      if (/[0-9]/.test(C)) I.str += C;
      else I.arr[R] = 1
    }
    S = "";
    _.lastIndex = 0;
    while ((K = _.exec($dp.dateFmt)) !== null) {
      X = K.index - (K[0] == "%ld" ? 1 : 0);
      if (N >= 0) {
        S += $dp.dateFmt.substring(N, X);
        if (F >= N + J && F <= X + J) F += X - N
      }
      N = _.lastIndex;
      G = N - X;
      B = I.str.substring(0, G);
      A = K[0].charAt(0);
      $ = pInt(B.charAt(0));
      if (I.str.length > 1) {
        V = I.str.charAt(1);
        W = $ * 10 + pInt(V)
      } else {
        V = "";
        W = $
      }
      if (I.arr[X + 1] || A == "M" && W > 12 || A == "d" && W > 31 || A == "H" && W > 23 || "ms".indexOf(A) >= 0 && W > 59) {
        if (K[0].length == 2) B = "0" + $;
        else B = $;
        F++
      } else if (G == 1) {
        B = W;
        G++;
        J++
      }
      S += B;
      I.str = I.str.substring(G);
      if (I.str == "") break
    }
    T.value = S;
    P(T, F);
    _cancelKey(M)
  }
  if (isShow && $c.currFocus != $dp.el && !((Q >= 48 && Q <= 57) || Q == 8 || Q == 46)) _cancelKey(M);
  function E(A) {
    var _ = 0;
    if ($dp.win.document.selection) {
      var B = $dp.win.document.selection.createRange(),
      $ = B.text.length;
      B.moveStart("character", -A.value.length);
      _ = B.text.length - $
    } else if (A.selectionStart || A.selectionStart == "0") _ = A.selectionStart;
    return _
  }
  function P(_, A) {
    if (_.setSelectionRange) {
      _.focus();
      _.setSelectionRange(A, A)
    } else if (_.createTextRange) {
      var $ = _.createTextRange();
      $.collapse(true);
      $.moveEnd("character", A);
      $.moveStart("character", A);
      $.select()
    }
  }
}
document.ready = 1